<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QStyleOptionViewItem Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QStyleOptionViewItem Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QStyleOptionViewItem class is used to describe the
parameters used to draw an item in a view widget. <a href="#details">More...</a></p>

<p>Inherits <a href="qstyleoption.html">QStyleOption</a>.</p><p>Inherited by <a href="qstyleoptionviewitemv2.html">QStyleOptionViewItemV2</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qstyleoptionviewitem.html#Position-enum">Position</a></b> { Left, Right, Top, Bottom }</li><li><div class="fn" />enum <b><a href="qstyleoptionviewitem.html#StyleOptionType-enum">StyleOptionType</a></b> { Type }</li><li><div class="fn" />enum <b><a href="qstyleoptionviewitem.html#StyleOptionVersion-enum">StyleOptionVersion</a></b> { Version }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qstyleoptionviewitem.html#QStyleOptionViewItem">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qstyleoptionviewitem.html#QStyleOptionViewItem-2">__init__</a></b> (<i>self</i>, QStyleOptionViewItem&#160;<i>other</i>)</li></ul><h3>Members</h3><ul><li><div class="fn" />Qt.Alignment <b><a href="qstyleoptionviewitem.html#decorationAlignment-var">decorationAlignment</a></b></li><li><div class="fn" />Position <b><a href="qstyleoptionviewitem.html#decorationPosition-var">decorationPosition</a></b></li><li><div class="fn" />QSize <b><a href="qstyleoptionviewitem.html#decorationSize-var">decorationSize</a></b></li><li><div class="fn" />Qt.Alignment <b><a href="qstyleoptionviewitem.html#displayAlignment-var">displayAlignment</a></b></li><li><div class="fn" />QFont <b><a href="qstyleoptionviewitem.html#font-var">font</a></b></li><li><div class="fn" />bool <b><a href="qstyleoptionviewitem.html#showDecorationSelected-var">showDecorationSelected</a></b></li><li><div class="fn" />Qt.TextElideMode <b><a href="qstyleoptionviewitem.html#textElideMode-var">textElideMode</a></b></li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QStyleOptionViewItem class is used to describe the
parameters used to draw an item in a view widget.</p>
<p>QStyleOptionViewItem contains all the information that <a href="qstyle.html">QStyle</a> functions need to draw the items for Qt's
model/view classes.</p>
<p>For performance reasons, the access to the member variables is
direct (i.e., using the <tt>.</tt> or <tt>-&gt;</tt> operator).
This low-level feel makes the structures straightforward to use and
emphasizes that these are simply parameters used by the style
functions.</p>
<p>For an example demonstrating how style options can be used, see
the <a href="widgets-styles.html">Styles</a> example.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Position-enum" />QStyleOptionViewItem.Position</h3><p>This enum describes the position of the item's decoration.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionViewItem.Left</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">On the left of the text.</td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionViewItem.Right</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">On the right of the text.</td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionViewItem.Top</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Above the text.</td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionViewItem.Bottom</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">Below the text.</td>
</tr>
</table>
<p><b>See also</b> <a href="qstyleoptionviewitem.html#decorationPosition-var">decorationPosition</a>.</p>


<h3 class="fn"><a name="StyleOptionType-enum" />QStyleOptionViewItem.StyleOptionType</h3><p>This enum is used to hold information about the type of the
style option, and is defined for each <a href="qstyleoption.html">QStyleOption</a> subclass.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionViewItem.Type</tt></td>
<td class="topAlign"><tt>SO_ViewItem</tt></td>
<td class="topAlign">The type of style option provided (<a href="qstyleoption.html#OptionType-enum">SO_ViewItem</a> for this
class).</td>
</tr>
</table>
<p>The type is used internally by <a href="qstyleoption.html">QStyleOption</a>, its subclasses, and <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>() to
determine the type of style option. In general you do not need to
worry about this unless you want to create your own <a href="qstyleoption.html">QStyleOption</a> subclass and your own
styles.</p>
<p><b>See also</b> <a href="qstyleoptionviewitem.html#StyleOptionVersion-enum">StyleOptionVersion</a>.</p>


<h3 class="fn"><a name="StyleOptionVersion-enum" />QStyleOptionViewItem.StyleOptionVersion</h3><p>This enum is used to hold information about the version of the
style option, and is defined for each <a href="qstyleoption.html">QStyleOption</a> subclass.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionViewItem.Version</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">1</td>
</tr>
</table>
<p>The version is used by <a href="qstyleoption.html">QStyleOption</a> subclasses to implement
extensions without breaking compatibility. If you use <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>(), you
normally do not need to check it.</p>
<p><b>See also</b> <a href="qstyleoptionviewitem.html#StyleOptionType-enum">StyleOptionType</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QStyleOptionViewItem" />QStyleOptionViewItem.__init__ (<i>self</i>)</h3><p>Constructs a <a href="qstyleoptionviewitem.html">QStyleOptionViewItem</a>, initializing
the members variables to their default values.</p>


<h3 class="fn"><a name="QStyleOptionViewItem-2" />QStyleOptionViewItem.__init__ (<i>self</i>, <a href="qstyleoptionviewitem.html">QStyleOptionViewItem</a>&#160;<i>other</i>)</h3><p>Constructs a copy of the <i>other</i> style option.</p>
<hr /><h2>Member Documentation</h2><h3 class="fn"><a name="decorationAlignment-var" /><a href="qt-alignment.html">Qt.Alignment</a> decorationAlignment</h3><p>This variable holds the alignment of the decoration for the
item.</p>
<p>The default value is <a href="qt.html#AlignmentFlag-enum">Qt.AlignLeft</a>.</p>


<h3 class="fn"><a name="decorationPosition-var" /><a href="qstyleoptionviewitem.html#Position-enum">Position</a> decorationPosition</h3><p>This variable holds the position of the decoration for the
item.</p>
<p>The default value is <a href="qstyleoptionviewitem.html#Position-enum">Left</a>.</p>
<p><b>See also</b> <a href="qstyleoptionviewitem.html#Position-enum">Position</a>.</p>


<h3 class="fn"><a name="decorationSize-var" /><a href="qsize.html">QSize</a> decorationSize</h3><p>This variable holds the size of the decoration for the item.</p>
<p>The default value is <a href="qsize.html">QSize</a>(-1, -1),
i.e. an invalid size.</p>
<p><b>See also</b> <a href="qstyleoptionviewitem.html#decorationAlignment-var">decorationAlignment</a>
and <a href="qstyleoptionviewitem.html#decorationPosition-var">decorationPosition</a>.</p>


<h3 class="fn"><a name="displayAlignment-var" /><a href="qt-alignment.html">Qt.Alignment</a> displayAlignment</h3><p>This variable holds the alignment of the display value for the
item.</p>
<p>The default value is <a href="qt.html#AlignmentFlag-enum">Qt.AlignLeft</a>.</p>


<h3 class="fn"><a name="font-var" /><a href="qfont.html">QFont</a> font</h3><p>This variable holds the font used for the item.</p>
<p>By default, the application's default font is used.</p>
<p><b>See also</b> <a href="qfont.html">QFont</a>.</p>


<h3 class="fn"><a name="showDecorationSelected-var" />bool showDecorationSelected</h3><p>This variable holds whether the decoration should be highlighted
on selected items.</p>
<p>If this option is true, the branch and any decorations on
selected items should be highlighted, indicating that the item is
selected; otherwise, no highlighting is required. The default value
is false.</p>
<p><b>See also</b> <a href="qstyle.html#StyleHint-enum">QStyle.SH_ItemView_ShowDecorationSelected</a>
and <a href="qabstractitemview.html">QAbstractItemView</a>.</p>


<h3 class="fn"><a name="textElideMode-var" /><a href="qt.html#TextElideMode-enum">Qt.TextElideMode</a> textElideMode</h3><p>This variable holds where ellipsis should be added for text that
is too long to fit into an item.</p>
<p>The default value is <a href="qt.html#TextElideMode-enum">Qt.ElideMiddle</a>, i.e. the ellipsis
appears in the middle of the text.</p>
<p><b>See also</b> <a href="qt.html#TextElideMode-enum">Qt.TextElideMode</a> and <a href="qstyle.html#StyleHint-enum">QStyle.SH_ItemView_EllipsisLocation</a>.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;snapshot-4.9.5-9eb6aac99275 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.3</td></tr></table></div></address></body></html>